<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Run-time error information</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB Installation and Build Guide" />
    <link rel="up" href="debug.html" title="Chapter 3.  Debugging Applications" />
    <link rel="prev" href="debug_compile.html" title="Compile-time configuration" />
    <link rel="next" href="debug_printlog.html" title="Reviewing Berkeley DB log files" />
  </head>
  <body>
    <div xmlns="" class="navheader">
      <div class="libver">
        <p>Library Version 12.1.6.2</p>
      </div>
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Run-time error information</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="debug_compile.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 3.  Debugging Applications </th>
          <td width="20%" align="right"> <a accesskey="n" href="debug_printlog.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="debug_runtime"></a>Run-time error information</h2>
          </div>
        </div>
      </div>
      <p>
        Normally, when an error occurs in the Berkeley DB library,
        an integer value (either a Berkeley DB specific value or a
        system <code class="literal">errno</code> value) is returned by Berkeley
        DB. In some cases, however, this value may be insufficient to
        completely describe the cause of the error, especially during
        initial application debugging.
    </p>
      <p>
        Most Berkeley DB errors will result in additional
        information being written to a standard file descriptor or
        output stream. Additionally, Berkeley DB can be configured to
        pass these verbose error messages to an application function.
        There are four methods intended to provide applications with
        additional error information: <a href="../api_reference/C/envset_errcall.html" class="olink">DB_ENV-&gt;set_errcall()</a>,
        <a href="../api_reference/C/envset_errfile.html" class="olink">DB_ENV-&gt;set_errfile()</a>, <a href="../api_reference/C/envset_errpfx.html" class="olink">DB_ENV-&gt;set_errpfx()</a> and <a href="../api_reference/C/envset_verbose.html" class="olink">DB_ENV-&gt;set_verbose()</a>.
    </p>
      <p>
        The Berkeley DB error-reporting facilities do not slow
        performance or significantly increase application size, and
        may be run during normal operation as well as during
        debugging. Where possible, we recommend these options always
        be configured and the output saved in the filesystem. We have
        found that this often saves time when debugging installation
        or other system-integration problems.
    </p>
      <p>
        In addition, there are three methods to assist applications
        in displaying their own error messages: <a href="../api_reference/C/envstrerror.html" class="olink">db_strerror()</a>,
        <a href="../api_reference/C/enverr.html" class="olink">DB_ENV-&gt;err()</a>, and <code class="methodname">DB_ENV-&gt;errx()</code>. The
        first is a superset of the ANSI C strerror function, and
        returns a descriptive string for any error return from the
        Berkeley DB library. The <a href="../api_reference/C/enverr.html" class="olink">DB_ENV-&gt;err()</a> and
        <code class="methodname">DB_ENV-&gt;errx()</code> methods use the
        error message configuration options described previously to
        format and display error messages to appropriate output
        devices.
    </p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="debug_compile.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="debug.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="debug_printlog.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Compile-time configuration </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Reviewing Berkeley DB log files</td>
        </tr>
      </table>
    </div>
  </body>
</html>
